#!/bin/bash
count=`ps -ef | grep ubaby:server | grep -v "grep" | wc -l`;
echo $count;
echo $count >> /mnt/sdc/dev/www/ubaby_admin/data/mjh_swoole.log
#if [ $count -lt 1 ]; then
ps -ef | grep ubaby:server | grep -v "grep" | awk '{print $2}'|xargs kill -9
kill -9 `lsof -t -i:9888`
kill -9 $(ps -ef|grep ubaby_server|gawk '$0 !~/grep/ {print $2}' |tr -s '\n' ' ')
sleep 2
ulimit -c unlimited
/www/server/php/71/bin/php  /mnt/sdc/dev/www/ubaby_admin/think ubaby:server
echo "restart";
echo $(date +%Y-%m-%d_%H:%M:%S) >> /mnt/sdc/dev/www/ubaby_admin/data/mjh_swoole.log

